#define DEBUG
#include <cstdio>
#define MAXN 100000
#define MAXK 100000
#define MAXQ 100000
#define CP(x) ((x-1)%n)+1

using namespace std;

int main() {
#ifdef DEBUG
  freopen("1.in", "r", stdin);
  freopen("1.out", "w", stdout);
#endif

  static int a[MAXN+1], temp[MAXN+1], com[MAXQ+1][2];
  int n, k, q;
  scanf("%d %d %d", &n, &k, &q);
  for (int i=1; i<=q; i++) {
    scanf("%d %d", com[i], com[i]+1);
  }
  for (int i=1; i<=n; i++) {
    scanf("%d", a+i);
  }

  int pos=0;
  for (int i=q; i>0; i--) {
    if (com[i][0]==1) {
      int x=((-com[i][1])%k+k)%k;
      for (int j=1; j<=n/k; j++) {
	for (int l=k-x+1; l<=k; l++) {
	  temp[l+x-k]=a[CP(pos+j*k-k+l)];
	}
	for (int l=k-x; l>0; l--) {
	  a[CP(pos+j*k-k+l+x)] = a[CP(pos+j*k-k+l)];
	}
	for (int l=1; l<=x; l++) {
	  a[CP(pos+j*k-k+l)] = temp[l];
	}
      }
    } else {
      pos = (pos+com[i][1]%n+n-1)%n+1;
    }
  }

  for (int i=1; i<=n; i++) {
    printf("%d ", a[CP(pos+i)]);
  }

  fcloseall();
}
